package com.lwj.liwanjia.view.activity.work;

import android.view.View;

import android.widget.TextView;

import com.lwj.liwanjia.R;
import com.lwj.liwanjia.adapter.WorkHomeAdapter;
import com.lwj.liwanjia.base.BaseActivity;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by 001 on 2017/9/12.
 */

public class WorkHomeActivity extends BaseActivity implements View.OnClickListener {

    private TextView tv_back;
    private TextView tv_title;
    private CustomListViewWorkHome mListView;
    private WorkHomeAdapter workAdapter;
    private List<Integer> workList;

    @Override
    protected void initView() {

        tv_back = (TextView) findViewById(R.id.tv_left);
        tv_title = (TextView) findViewById(R.id.tv_title);
        mListView = (CustomListViewWorkHome) findViewById(R.id.listView);

        tv_back.setVisibility(View.VISIBLE);
        tv_title.setVisibility(View.VISIBLE);
        tv_title.setText("我的工作");

        tv_back.setOnClickListener(this);

    }

    @Override
    protected void initData() {

        //假数据
        initListView();
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_work_home;
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            //返回
            case R.id.tv_left:
                finish();
                break;
        }
    }

    //假数据
    private void initListView() {
        workList = new ArrayList<>();
        workList.add(R.mipmap.picture_01);
        workAdapter = new WorkHomeAdapter(WorkHomeActivity.this, workList);
        mListView.setAdapter(workAdapter);
    }
}
